﻿using System;
using System.ComponentModel;

namespace NTTDATA.BEENChina.ResultCertification.PropertyGridUtil
{
    internal class CustomCollectionConverter<T> : ExpandableObjectConverter where T: PropertyData 
    {
        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
        {
            if (destType == typeof(string) && value is CustomCollection<T>)
            {
                // Return department and department role separated by comma.
                //return "检查对照表数据";

                return ((CustomCollection<T>)value).Description;
            }
            return base.ConvertTo(context, culture, value, destType);
        }
    }
}
